﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Multilookup.aspx.cs" Inherits="Omu.AwesomeWebFormsDemo.Multilookup" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1>MultiLookup</h1>
<p class="xpl">a readonly field with a button near it, on button click a window pops up, where user can search, select and deselect multiple values</p>
<h2>
            MultiLookup with pagination (more results button)
        </h2>        
        
        <o:MultiLookup runat="server" ID="Fruits" GetMultipleUrl="~/svc/aja.svc/FruitGetMultiple"
            SearchUrl='~/svc/aja.svc/FruitSearch' SelectedUrl="~/svc/aja.svc/FruitSelected"
            Value='["1","2","3"]' FullScreen="True"
            Title="Select items and by clicking the up and down buttons" ClearButton="true" />
        <h2>
            bound to ajaxdropdown using parentId</h2>
        unlike the AjaxDropdown the Multilookup will keep its value when the value of its
        parent is changed<br />
        can be bound to anything else HiddenField, TextBox, Multilookup etc.<br />
        <o:AjaxDropdown runat="server" ID="Categories" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown>
        <br />
        <%
            FruitsByCategory.ParentId = Categories.ClientID;
        %>
        <o:MultiLookup runat="server" ID="FruitsByCategory" GetMultipleUrl="~/svc/aja.svc/FruitGetMultiple"
            SearchUrl='~/svc/aja.svc/FruitsByCategorySearch' SelectedUrl="~/svc/aja.svc/FruitSelected" Modal="true" Value="[3,2]" PopupWidth="700" PopupHeight="500"/>
        <h2>
            Bound to 2 dropdowns (using Data)</h2>
        <o:AjaxDropdown runat="server" ID="Cat1" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown>
        <o:AjaxDropdown runat="server" ID="Cat2" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown>
        <%
            FruitsFrom2Cat.Data = new Dictionary<string, string>
                                      {
                                          {"cat1", Cat1.ClientID},
                                          {"cat2", Cat2.ClientID},
                                      };
%>
        <o:MultiLookup runat="server" ID="FruitsFrom2Cat" GetMultipleUrl="~/svc/aja.svc/FruitGetMultiple"
            SearchUrl='~/svc/aja.svc/FruitsFrom2CatSearch' SelectedUrl="~/svc/aja.svc/FruitSelected" Value="[5,4,3]" />
            
            <h2>send predefined parameters</h2>
            <%
                FruitsByCategoryPar.Parameters = new Dictionary<string, string>{{"parent","3"}};
                 %>
            <o:MultiLookup runat="server" ID="FruitsByCategoryPar" GetMultipleUrl="~/svc/aja.svc/FruitGetMultiple"
            SearchUrl='~/svc/aja.svc/FruitsByCategorySearch' SelectedUrl="~/svc/aja.svc/FruitSelected"            
            FullScreen="true" Value="[20,21]" />
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Submit" />
</asp:Content>